package com.appkubes.mall.restful.application.user.user.dao;

import com.appkubes.mall.core.dao.BaseMallUserDao;
import com.appkubes.mall.core.entity.MallUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

@Mapper
@Repository
public interface UserDao extends BaseMallUserDao {

    @Select({"SELECT * FROM mall_user WHERE tel=#{tel}"})
    MallUser selectByTel(@Param("tel") String tel);

    @Select({"SELECT * FROM mall_user WHERE user_key=#{userKey} ORDER BY create_time DESC LIMIT 1"})
    MallUser queryById(@Param("userKey") String userKey);


}
